/*
package com.frank.statisticsInterface;

import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;

*/
/**
 * @author 小石潭记
 * @date 2020/11/6 17:08
 * @Description: ${todo}
 *//*

@Component
@Aspect
public class ControllerAdvice {
    private static ILogger log = LoggerFactory.getLogger(ControllerAdvice.class);

    @Around("execution(public * *..*controller.*.*(..))")
    public Object handle(ProceedingJoinPoint proceedingJoinPoint) throws Throwable {
        Object result;
        try {
            Function<ProceedingJoinPoint, AbstractControllerHandler> build = AbstractControllerHandler.getBuild();
            if (null == build) {
                AbstractControllerHandler.registerBuildFunction(DefaultControllerHandler::new);
            }
            build = AbstractControllerHandler.getBuild();
            AbstractControllerHandler controllerHandler = build.apply(proceedingJoinPoint);
            if (null == controllerHandler) {
                log.warn(String.format("The method(%s) do not be handle by controller handler.", proceedingJoinPoint.getSignature().getName()));
                result = proceedingJoinPoint.proceed();
            } else {
                result = controllerHandler.handle();
            }
        } catch (Throwable throwable) {
            RuntimeHealthIndicator.failedRequestCount++;
            log.error(new Exception(throwable), "Unknown exception- -!");

            throw throwable;
        }

        return result;
    }
}
*/
